package Exercise100;

import java.util.Scanner;

public class UserTest {
    public static void main(String[] args) {
        String un1 = "mengyuhe123";
        String p1 = "Lf0098761";
        int count = 3;
        while (count != 0) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入用户名：");
            String input1 = sc.next();
            System.out.println("请输入密码：");
            String input2 = sc.next();
            if (input1.equals(un1)) {
                if (input2.equals(p1)) {
                    System.out.println("niubi");
                    break;
                } else {
                    System.out.println("密码错误");
                    count--;
                    System.out.println("还有" + count + "次输入机会");
                }
            } else {
                System.out.println("用户名输入错误或者不存在");
                count--;
                System.out.println("还有" + count + "次输入机会");
            }
        }
    }
}
